@iconfont-css-prefix: anticon;
@progress-radius: 100px;
@ease-out-circ: cubic-bezier(0.08, 0.82, 0.17, 1);
@ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);

.nom-progress {
  .reset-component();

  display: inline-block;

  &-line {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    font-size: @font-size-base;
  }

  &-steps {
    display: inline-block;

    &-outer {
      display: flex;
      flex-direction: row;
      align-items: center;
    }

    &-item {
      flex-shrink: 0;
      min-width: 2px;
      margin-right: 2px;
      background: var(--nom-process-steps-item-bg);
      transition: all 0.3s;

      &-active {
        background: var(--nom-color-primary);
      }
    }
  }

  &-small&-line,
  &-small&-line &-text .@{iconfont-css-prefix} {
    font-size: @font-size-sm;
  }

  &-outer {
    display: inline-block;
    width: 100%;
    margin-right: 0;
    padding-right: 0;

    .nom-progress-show-info & {
      margin-right: ~'calc(-2em - 8px)';
      padding-right: ~'calc(2em + 8px)';
    }
  }

  &-inner {
    position: relative;
    display: inline-block;
    width: 100%;
    overflow: hidden;
    vertical-align: middle;
    background-color: var(--nom-process-remaining-color);
    border-radius: @progress-radius;
  }

  &-circle-trail {
    stroke: var(--nom-process-remaining-color);
  }

  &-circle-path {
    animation: nom-progress-appear 0.3s;
  }

  &-inner:not(.nom-progress-circle-gradient) {
    .nom-progress-circle-path {
      stroke: var(--nom-color-primary);
    }
  }

  &-success-bg,
  &-bg {
    position: relative;
    background-color: var(--nom-color-primary);
    border-radius: @progress-radius;
    transition: all 0.4s @ease-out-circ 0s;
  }

  &-success-bg {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--nom-color-success);
  }

  &-text {
    display: inline-block;
    width: 2em;
    margin-left: 8px;
    color: var(--nom-color-black);
    font-size: 1em;
    line-height: 1;
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
    word-break: normal;

    .@{iconfont-css-prefix} {
      font-size: @font-size-base;
    }
  }

  &-status-active {
    .nom-progress-bg::before {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background: var(--nom-color-bg-0);
      border-radius: 10px;
      opacity: 0;
      animation: nom-progress-active 2.4s @ease-out-quint infinite;
      content: '';
    }
  }

  &-status-exception {
    .nom-progress-bg {
      background-color: var(--nom-color-danger);
    }

    .nom-progress-text {
      color: var(--nom-color-danger);
    }
  }

  &-status-exception &-inner:not(.nom-progress-circle-gradient) {
    .nom-progress-circle-path {
      stroke: var(--nom-color-danger);
    }
  }

  &-status-success {
    .nom-progress-bg {
      background-color: var(--nom-color-success);
    }

    .nom-progress-text {
      color: var(--nom-color-success);
    }
  }

  &-status-success &-inner:not(.nom-progress-circle-gradient) {
    .nom-progress-circle-path {
      stroke: var(--nom-color-success);
    }
  }

  &-circle &-inner {
    position: relative;
    line-height: 1;
    background-color: transparent;
  }

  &-circle &-text {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    margin: 0;
    padding: 0;
    color: var(--nom-color-text-0);
    font-size: 1em;
    line-height: 1;
    white-space: normal;
    text-align: center;
    transform: translate(-50%, -50%);

    .@{iconfont-css-prefix} {
      font-size: (14 / 12em);
    }
  }

  &-circle&-status-exception {
    .nom-progress-text {
      color: var(--nom-color-danger);
    }
  }

  &-circle&-status-success {
    .nom-progress-text {
      color: var(--nom-color-success);
    }
  }
}

@keyframes nom-progress-active {
  0% {
    width: 0;
    opacity: 0.1;
  }

  20% {
    width: 0;
    opacity: 0.5;
  }

  100% {
    width: 100%;
    opacity: 0;
  }
}
